#ifndef INC_PROTOTYPETOOL_H
#define INC_PROTOTYPETOOL_H

#include "Tool.h"
#include "PlaceCommand.h"

#include <boost/scoped_ptr.hpp>

class UMLObject;
class DiagramMan;

class PrototypeTool : public Tool
{
	public:
		/**
		 * Constructs a PrototypeTool that will create UMLObjects from the given
		 * prototype.
		 */
		PrototypeTool(DiagramMan& dman, const UMLObject& prototype);
		PrototypeTool(const PrototypeTool&);

		/* Despite rule of three, we don't need a destructor because scoped_ptr
		 * takes care of all destruction for us. We only need operator= and copy
		 * constructor because scoped_ptr doesn't define a copy constructor. */

		/*** Operators ***/
		PrototypeTool& operator=(const PrototypeTool&);

		/*** MOUSE HOOKS ***/
		void click(QMouseEvent&);
		void startDrag(QPoint&);
		void drag(QMouseEvent&);
		void endDrag(QMouseEvent&);

	private:
		boost::scoped_ptr<UMLObject> _prototype;
		std::auto_ptr<PlaceCommand> _cmd;
		// logical coords
		QPoint _lastDrag;
};

#endif // INC_PROTOTYPETOOL_H

